package com.example.mylibrarybase.yumengmeng15.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.mylibrarybase.R;
import com.example.mylibrarybase.bar.initAction_Bar;
import com.example.mylibrarybase.base.baseui.BaseActivity;
import com.example.mylibrarybase.yumengmeng04.adapter.MyListView_04_single;
import com.example.mylibrarybase.yumengmeng04.base.BaseListViewAdapter_04;
import com.example.mylibrarybase.yumengmeng04.view.listViewlist_04;
import com.example.mylibrarybase.yumengmeng15.adapter.MyListView_15;
import com.example.mylibrarybase.yumengmeng15.bean.items;

import java.util.ArrayList;

public class MainActivity_15_flexible extends BaseActivity implements View.OnClickListener {

    private initAction_Bar mBase_action_bar;
//    private TextView mMainActivity_15_flexible_tv;
//    private LinearLayout MainActivity_15_flexible_ll;
//    private flexibleRelativeLayout_15 mFlexibleRelativeLayout_15;
    private listViewlist_04 mMainActivity_15_flexible_listview;
    private MyListView_04_single mMyListView_04;
    private MyListView_15 mMyListView_15;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    @Override
    public int getlayouXML() {
        return R.layout.activity_main_15_flexible;
    }

    @Override
    public void initView() {
        mBase_action_bar =
                (initAction_Bar) findViewById(R.id.base_action_bar);
        mBase_action_bar.setMode(initAction_Bar.AUTO_ONCLICK_MODE)
                .setCallBack(new initAction_Bar.Action_bar_call_back() {
                    @Override
                    public void getAction_barView_backbutton(TextView textView) {

                    }

                    @Override
                    public void getAction_barView_backbutton_icon(ImageView imageView) {

                    }

                    @Override
                    public void getAction_barView_title(TextView textView) {
                        textView.setText("伸缩长度的view");
                    }

                    @Override
                    public void getAction_barView_right_icon(ImageView imageView) {

                    }
                });
//        mFlexibleRelativeLayout_15 = (flexibleRelativeLayout_15) findViewById(R.id.flexibleRelativeLayout_15);
//        mFlexibleRelativeLayout_15.setCallBack(new flexibleRelativeLayout_15.CallBack() {
//            @Override
//            public void getTaginfo(boolean tag) {
//                LogUtils.i("tag"+tag);
//            }
//        });
//
        mMainActivity_15_flexible_listview = (listViewlist_04) findViewById(R.id.MainActivity_15_flexible_listview);
        initData();
    }

    @Override
    public void initData() {
        ArrayList<items> strings = new ArrayList<>();

        for (int i = 0; i < 40; i++) {
            strings.add(new items(""+i,"i"+i));
        }
        mMyListView_15 = new MyListView_15(this, 0, strings, new BaseListViewAdapter_04.CallBack() {
            @Override
            public void loadMore(View view, int position, int type) {
                view.setVisibility(View.GONE);
            }
        });

        mMainActivity_15_flexible_listview.setAdapter(mMyListView_15);
    }

    @Override
    public void onClick(View view) {
       // Utilsflexible.sumbit(mMainActivity_15_flexible_tv, MainActivity_15_flexible_ll);
    }
}
